/*
 * Copyright (c) 2009 by unreserved.org.
 * All rights reserved.
 */

package org.unreserved.ladderplot;

import java.util.*;
import org.apache.log4j.Logger;

/**
 * Group of Events to be rendered horizontally.
 */
public class HGroup implements Container, Event {
    private static final Logger logger = Logger.getLogger(HGroup.class);
    
    protected ArrayList<Event> events = new ArrayList<Event>();
    protected VAlignment vAlignment = VAlignment.BOTTOM;
    
    public void addEvent(Event ev) {
        logger.debug("addEvent: " + ev);
        events.add(ev);
    }
    
    public ArrayList<Event> getEvents() {
        return events;
    }
    
    public void setVAlignment(VAlignment vAlignment) {
        this.vAlignment = vAlignment;
    }
    
    public VAlignment getVAlignment() {
        return vAlignment;
    }
    
    // from Event
    public void accept(ModelVisitor visitor) {
        visitor.visit(this);
    }
}
